﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Ruanmou.Comm.Models
{
    /// <summary>
    /// 用于Ajax请求返回结果
    /// </summary>
    public class AjaxResult
    {
        /// <summary>
        /// 调试信息
        /// </summary>
        public string DebugMsg { get; set; } =string.Empty;
        /// <summary>
        /// 弹出框信息
        /// </summary>
        public string PromptMsg { get; set; } = string.Empty;
        /// <summary>
        /// 状态码
        /// </summary>
        public CodeResult Result { get; set; } = CodeResult.Success;
        /// <summary>
        /// 返回值
        /// </summary>
        public object Data { get; set; } = new { };
        /// <summary>
        /// 预留字段
        /// </summary>
        public object Tag { get; set; } = new { };

        public enum CodeResult
        {
            //失败
            Failed = 0,
            //成功
            Success = 1,
            //超时
            OverTime = 2,
            //未授权
            NoAuthorization = 3,
            //其他
            Other = 255
        }
    }
}
